package interview1719;

/**
 * 按照顺序找少的数,不合题意
 *
 * @author CaoYu
 * @date 2021年9月26日
 * @description
 */
public class View extends View1719 {

	@Override
	public int[] missingTwo(int[] nums) {
		int len = nums.length;
		int[] ans = new int[2];
		int pans = 1;
		if (len == 1) {
			for (int i = 1; i <= 3; i++) {
				if (i != nums[0]) {
					ans[pans - 1] = i;
					pans++;
				}
			}
			return ans;
		}
		for (int i = 0; i < len; i++) {
			if (nums[i] != i + pans) {
				ans[pans - 1] = i + pans;
				pans++;
				if (pans == 3)
					return ans;
			}
		}
		for (; pans < 3; pans++) {
			ans[pans - 1] = len + pans;
		}
		return ans;
	}

	public static void main(String[] args) {
		View v = new View();
		v.debug1();
		v.debug2();
		v.debug3();
		v.debug4();

	}

}
